<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%  
    String path = request.getContextPath();  
    String basePath = request.getScheme() + "://"  
            + request.getServerName() + ":" + request.getServerPort()  
            + path + "/";  
%>  
<html>
<title>添加用户</title>
<link	href="https://cdn.bootcss.com/bootstrap/4.1.0/css/bootstrap.min.css"	rel="stylesheet">
<script type="text/javascript"	src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
<script	src="https://cdn.bootcss.com/bootstrap/4.1.0/js/bootstrap.min.js"></script>
<script type="text/javascript" src="${path}/static/test.yt"></script>
</head>
<body>
<div class="container">
		<!-- 标题 -->
		<div class="row">
			<div class="col-md-12">
				    <h1>添加用户</h1>
			</div>
		</div>
		<hr>
	<div class="row">
			<div class="col-md-12">
    <form action="" name="userForm">
        姓名：<input type="text" name="name"><br>
         密码：<input type="text" name="password"><br>
         年龄：<input type="text" name="age"><br>
<br/>
          <input type="button" value="添加" class="btn btn-primary"
            onclick="addUser()"> <input type="button" value="返回" class="btn btn-primary"
            onclick="goList()">
    </form>
</div></div>
    <script type="text/javascript">
    function goList(){
    	window.location.href="<%=basePath %>user/userInfo";
    }
        function addUser() {
            var form = document.forms[0];
            form.action = "<%=basePath %>user/addUser";
            form.method = "post";
            form.submit();
        }
    </script>
</body>
</html>